package com.terrace.db.system.service;

import java.util.List;

import com.terrace.db.system.mapper.entity.Organization;
import com.terrace.db.system.mapper.entity.UserOrganization;
import com.terrace.core.mybatis.entity.Pagination;

/**
 * 组织机构Service
 * @author jiangyg
 *
 */
public interface OrganizationService {
	
	public int saveOrganizationSelective(Organization org);
	
	public int saveUserOrganization(UserOrganization userOrganization);
	
	public int deleteUserOrganizationById(String userId, String orgId);

	public int deleteOrganizationById(String orgId);

	public int updateOrganizationByIdSelective(Organization org);

	/**
	 * 根据ID查询机构
	 * @param orgId
	 * @return
	 */
	public Organization selectOrganizationById(String orgId);
	
	/**
	 * 根据用户ID获取用户所在机构
	 * @param userId
	 * @return
	 */
	public List<Organization> selectOrganizationsByUserId(String userId);
	
	/**
	 * 机构分页查询
	 * @param pagination
	 * @param org
	 * @return
	 */
	public Pagination<Organization> selectOrganizationForPagination(Pagination<Organization> pagination, Organization org);

}
